package src.test5;

import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        String expression=null;
        suffixConvertor sc=new suffixConvertor();
        ArrayList<String> res;
        Caculator caculator=new Caculator();
        Questions Iq=new Questions();
        Random random=new Random();
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入中缀表达式：");
        expression=scanner.nextLine();
        res=sc.getHouZuiBDS(expression);
        System.out.println("后缀表达式为："+res);
        NifixToSuffix nifixToSuffix=new NifixToSuffix();
        nifixToSuffix.conversion(expression);
        String result=caculator.evaluate(nifixToSuffix.getMessage());
        System.out.println("计算结果为："+result);
    }
}
